import React,{ Component } from 'react';
import './action.scss';
import { accountActionCount } from 'api/radar.js';
export default class Action extends Component{
	constructor (props) {
		super(props)
		this.state={
			actionInfo: {}
		}
	}
	componentDidMount () {
		accountActionCount().then(res => { //行为统计
			if (res.code === 1) {
				this.setState({
					actionInfo: res.data
				})
			}
		})
	}
	render(){
		return(
			<div className="action">
				<div className="action_title">
					<div className="action_box">
						<div>
							查看产品<br/>
							<span>{this.state.actionInfo.product_count}</span>次
						</div>
						<div>
							查看官网<br/>
							<span>{this.state.actionInfo.official_web_count}</span>次
						</div>
					</div>
					<div className="action_box">
						<div>
							复制微信<br/>
							<span>{this.state.actionInfo.copy_wx_count}</span>次
						</div>
						<div>
							转发名片<br/>
							<span>{this.state.actionInfo.forward_card_count}</span>次
						</div>
					</div>
				</div>
				<div className="action_content">
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-card"></i>查看名片
						</p>
						<span className="see_num">{this.state.actionInfo.browse_card_count}次</span>
					</div>
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-dynamic"></i>查看动态
						</p>
						<span className="see_num">{this.state.actionInfo.friend_circle_count}次</span>
					</div>
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-application"></i>咨询产品
						</p>
						<span className="see_num">{this.state.actionInfo.consultation_count}次</span>
					</div>
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-mobile"></i>保存电话
						</p>
						<span className="see_num">{this.state.actionInfo.save_tel_count}次</span>
					</div>
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-like"></i>点赞
						</p>
						<span className="see_num">{this.state.actionInfo.point_count}次</span>
					</div>
					<div className="action_content_list">
						<p className="see_option">
							<i className="glyphicon glyphicon-tel"></i>拨打电话
						</p>
						<span className="see_num">{this.state.actionInfo.tel_count}次</span>
					</div>
				</div>
			</div>
		)
	}
}